package com.ns002.yigou.quote.dao;

import com.ns002.yigou.quote.entity.Tuser;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import javax.persistence.NamedNativeQueries;
import javax.persistence.NamedNativeQuery;
import java.util.List;

/**
 * @Author xu
 * @Date 2017/7/25 0025 下午 8:41
 */
@Repository
public interface TuserDao extends PagingAndSortingRepository<Tuser, Long>, JpaSpecificationExecutor<Tuser> {

    Tuser findByUserName(String userName);

    @Query("from Tuser t where id = :id")
    Tuser queryFamilyList(@Param("id") Long id);


    @Query(value = ":sql", nativeQuery = true)
    void executeSql(@Param("sql") String sql);



}
